package a.j;

import java.awt.*;
import java.awt.geom.AffineTransform;
import java.awt.image.BufferedImage;
import java.awt.image.ConvolveOp;
import java.awt.image.ImagingOpException;
import java.awt.image.Kernel;

class bd
{
  public static final String a = "y.view.ShadowNodePainter.SHADOW_PAINTING";
  public static final double b = 3.0D;
  public static final Color c = new Color(0, 0, 0, 77);
  private static final int d = 9;
  private static final double e = 2.0D;
  private double f = 3.0D;
  private Color g = c;
  private boolean h;
  private BufferedImage i;
  private Image j;
  private Image k;
  private Image l;
  private Image m;
  private Image n;
  private Image p;
  private Image q;
  private Image r;
  private Image s;
  private Image t;
  private Image u;
  private Image v;
  private Image w;
  private Image x;
  private AlphaComposite y = AlphaComposite.getInstance(5, 1.0F);
  
  public bd()
  {
    this(3.0D, c);
  }
  
  public bd(double paramDouble)
  {
    this(paramDouble, c);
  }
  
  public bd(double paramDouble, Color paramColor)
  {
    a(paramDouble);
    a(paramColor);
  }
  
  public double a()
  {
    return this.f;
  }
  
  public void a(double paramDouble)
  {
    if (!ld.E)
    {
      if (this.f != paramDouble) {
        this.f = paramDouble;
      }
    }
    else {
      d();
    }
  }
  
  public Color b()
  {
    return this.g;
  }
  
  public void a(Color paramColor)
  {
    if (!ld.E)
    {
      if (this.g != paramColor) {
        this.g = paramColor;
      }
    }
    else {
      d();
    }
  }
  
  protected void d()
  {
    this.i = null;
  }
  
  public void a(Graphics2D paramGraphics2D, double paramDouble1, double paramDouble2, double paramDouble3, double paramDouble4)
  {
    boolean bool2 = ld.E;
    boolean bool1 = ld.D;
    if (((!bool2) && (this.h)) || ((bool2) || ((paramDouble3 <= 0.0D) || (paramDouble4 <= 0.0D)))) {
      return;
    }
    if (!bool2) {
      if (this.i == null) {
        try
        {
          a(paramGraphics2D);
        }
        catch (ImagingOpException localImagingOpException)
        {
          this.h = true;
          return;
        }
      }
    }
    Object localObject = paramGraphics2D.getRenderingHint(RenderingHints.KEY_INTERPOLATION);
    paramGraphics2D.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BILINEAR);
    int i1 = 32;
    int i2 = 16;
    int i3 = 3;
    int i4 = 3;
    double d1;
    AffineTransform localAffineTransform5;
    if (!bool2) {
      if (paramDouble3 <= i1)
      {
        if (!bool2) {
          if (paramDouble4 <= i1)
          {
            d1 = paramDouble3 / i1;
            double d2 = paramDouble4 / i1;
            localAffineTransform5 = new AffineTransform(i1 * 2 * d1 / 64.0D, 0.0D, 0.0D, i1 * 2 * d2 / 64.0D, i4 + paramDouble1 - i2 * d1, i3 + paramDouble2 - i2 * d2);
            paramGraphics2D.drawImage(this.i, localAffineTransform5, null);
            if (bool2) {
              break label237;
            }
            if (!bool1) {
              break label1090;
            }
          }
        }
        d1 = paramDouble3 / i1;
        label237:
        localAffineTransform3 = new AffineTransform(i1 * 2 * d1 / 64.0D, 0.0D, 0.0D, 1.0D, i4 + paramDouble1 - i2 * d1, i3 + paramDouble2 - i2);
        localAffineTransform4 = new AffineTransform(i1 * 2 * d1 / 64.0D, 0.0D, 0.0D, (paramDouble4 - i1) / 32.0D, i4 + paramDouble1 - i2 * d1, i3 + paramDouble2 + i2);
        localAffineTransform5 = new AffineTransform(i1 * 2 * d1 / 64.0D, 0.0D, 0.0D, 1.0D, i4 + paramDouble1 - i2 * d1, i3 + paramDouble2 + paramDouble4 - i2);
        paramGraphics2D.drawImage(this.v, localAffineTransform3, null);
        paramGraphics2D.drawImage(this.w, localAffineTransform4, null);
        paramGraphics2D.drawImage(this.x, localAffineTransform5, null);
        if ((!bool2) && (!bool1)) {
          break label1090;
        }
      }
    }
    if ((bool2) || (paramDouble4 <= i1))
    {
      d1 = paramDouble4 / i1;
      localAffineTransform3 = new AffineTransform(1.0D, 0.0D, 0.0D, i1 * 2 * d1 / 64.0D, i4 + paramDouble1 - i2, i3 + paramDouble2 - i2 * d1);
      localAffineTransform4 = new AffineTransform((paramDouble3 - i1) / 32.0D, 0.0D, 0.0D, i1 * 2 * d1 / 64.0D, i4 + paramDouble1 + i2, i3 + paramDouble2 - i2 * d1);
      if (bool2) {
        break label681;
      }
      localAffineTransform5 = new AffineTransform(1.0D, 0.0D, 0.0D, i1 * 2 * d1 / 64.0D, i4 + paramDouble1 + paramDouble3 - i2, i3 + paramDouble2 - i2 * d1);
      paramGraphics2D.drawImage(this.s, localAffineTransform3, null);
      paramGraphics2D.drawImage(this.t, localAffineTransform4, null);
      paramGraphics2D.drawImage(this.u, localAffineTransform5, null);
      if (!bool1) {
        break label1090;
      }
    }
    label681:
    AffineTransform localAffineTransform1 = new AffineTransform(1.0D, 0.0D, 0.0D, 1.0D, i4 + paramDouble1 - i2, i3 + paramDouble2 - i2);
    paramGraphics2D.drawImage(this.m, localAffineTransform1, null);
    if (paramDouble3 - i1 > 0.0D)
    {
      localAffineTransform2 = new AffineTransform((paramDouble3 - i1) / i1, 0.0D, 0.0D, 1.0D, i4 + paramDouble1 + i2, i3 + paramDouble2 - i2);
      paramGraphics2D.drawImage(this.j, localAffineTransform2, null);
    }
    AffineTransform localAffineTransform2 = new AffineTransform(1.0D, 0.0D, 0.0D, 1.0D, i4 + paramDouble1 + paramDouble3 - i2, i3 + paramDouble2 - i2);
    paramGraphics2D.drawImage(this.k, localAffineTransform2, null);
    if (paramDouble4 - i1 > 0.0D)
    {
      localAffineTransform3 = new AffineTransform(1.0D, 0.0D, 0.0D, (paramDouble4 - i1) / i1, i4 + paramDouble1 - i2, i3 + paramDouble2 + i2);
      localAffineTransform4 = new AffineTransform(1.0D, 0.0D, 0.0D, (paramDouble4 - i1) / i1, i4 + paramDouble1 + paramDouble3 - i2, i3 + paramDouble2 + i2);
      paramGraphics2D.drawImage(this.l, localAffineTransform3, null);
      paramGraphics2D.drawImage(this.n, localAffineTransform4, null);
    }
    AffineTransform localAffineTransform3 = new AffineTransform(1.0D, 0.0D, 0.0D, 1.0D, i4 + paramDouble1 - i2, i3 + paramDouble2 + paramDouble4 - i2);
    paramGraphics2D.drawImage(this.p, localAffineTransform3, null);
    if (paramDouble3 - i1 > 0.0D)
    {
      localAffineTransform4 = new AffineTransform((paramDouble3 - i1) / i1, 0.0D, 0.0D, 1.0D, i4 + paramDouble1 + i2, i3 + paramDouble2 + paramDouble4 - i2);
      paramGraphics2D.drawImage(this.q, localAffineTransform4, null);
    }
    AffineTransform localAffineTransform4 = new AffineTransform(1.0D, 0.0D, 0.0D, 1.0D, i4 + paramDouble1 + paramDouble3 - i2, i3 + paramDouble2 + paramDouble4 - i2);
    paramGraphics2D.drawImage(this.r, localAffineTransform4, null);
    label1090:
    if (null == localObject)
    {
      if (bool2) {
        break label1117;
      }
      kg.a(paramGraphics2D, RenderingHints.KEY_INTERPOLATION);
      if (!bool1) {
        return;
      }
    }
    label1117:
    paramGraphics2D.setRenderingHint(RenderingHints.KEY_INTERPOLATION, localObject);
  }
  
  protected void a(Graphics2D paramGraphics2D)
  {
    Kernel localKernel1 = new Kernel(1, 9, a(2.0D, 9));
    ConvolveOp localConvolveOp1 = new ConvolveOp(localKernel1, 1, null);
    Kernel localKernel2 = new Kernel(9, 1, a(2.0D, 9));
    ConvolveOp localConvolveOp2 = new ConvolveOp(localKernel2, 1, null);
    int i1 = (int)this.f;
    int i2 = (int)this.f;
    BufferedImage localBufferedImage = a(paramGraphics2D, localConvolveOp1, localConvolveOp2, i1, i2, 96, 96);
    this.m = localBufferedImage.getSubimage(0, 0, 32, 32);
    this.j = localBufferedImage.getSubimage(32, 0, 32, 32);
    this.k = localBufferedImage.getSubimage(64, 0, 32, 32);
    this.l = localBufferedImage.getSubimage(0, 32, 32, 32);
    this.n = localBufferedImage.getSubimage(64, 32, 32, 32);
    this.p = localBufferedImage.getSubimage(0, 64, 32, 32);
    this.q = localBufferedImage.getSubimage(32, 64, 32, 32);
    this.r = localBufferedImage.getSubimage(64, 64, 32, 32);
    localBufferedImage = a(paramGraphics2D, localConvolveOp1, localConvolveOp2, i1, i2, 64, 96);
    this.v = localBufferedImage.getSubimage(0, 0, 64, 32);
    this.w = localBufferedImage.getSubimage(0, 32, 64, 32);
    this.x = localBufferedImage.getSubimage(0, 64, 64, 32);
    localBufferedImage = a(paramGraphics2D, localConvolveOp1, localConvolveOp2, i1, i2, 96, 64);
    this.s = localBufferedImage.getSubimage(0, 0, 32, 64);
    this.t = localBufferedImage.getSubimage(32, 0, 32, 64);
    this.u = localBufferedImage.getSubimage(64, 0, 32, 64);
    this.i = a(paramGraphics2D, localConvolveOp1, localConvolveOp2, i1, i2, 64, 64);
  }
  
  private BufferedImage a(Graphics2D paramGraphics2D, ConvolveOp paramConvolveOp1, ConvolveOp paramConvolveOp2, int paramInt1, int paramInt2, int paramInt3, int paramInt4)
  {
    BufferedImage localBufferedImage1 = a(paramGraphics2D, paramInt3, paramInt4);
    Graphics2D localGraphics2D = (Graphics2D)localBufferedImage1.getGraphics();
    localGraphics2D.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
    localGraphics2D.setRenderingHint(RenderingHints.KEY_STROKE_CONTROL, RenderingHints.VALUE_STROKE_PURE);
    localGraphics2D.setColor(Color.BLACK);
    localGraphics2D.fillRoundRect(16, 16, paramInt3 - 32, paramInt4 - 32, paramInt1, paramInt2);
    localGraphics2D.setComposite(this.y);
    localGraphics2D.setColor(this.g);
    localGraphics2D.fillRect(0, 0, 96, 96);
    localGraphics2D.dispose();
    BufferedImage localBufferedImage2 = a(paramGraphics2D, paramInt3, paramInt4);
    paramConvolveOp2.filter(localBufferedImage1, localBufferedImage2);
    BufferedImage localBufferedImage3 = a(paramGraphics2D, paramInt3, paramInt4);
    paramConvolveOp1.filter(localBufferedImage2, localBufferedImage3);
    return localBufferedImage3;
  }
  
  private static BufferedImage a(Graphics2D paramGraphics2D, int paramInt1, int paramInt2)
  {
    GraphicsConfiguration localGraphicsConfiguration = paramGraphics2D.getDeviceConfiguration();
    if ((ld.E) || (localGraphicsConfiguration != null)) {
      return localGraphicsConfiguration.createCompatibleImage(paramInt1, paramInt2, 3);
    }
    return new BufferedImage(paramInt1, paramInt2, 2);
  }
  
  private static float[] a(double paramDouble, int paramInt)
  {
    boolean bool2 = ld.E;
    boolean bool1 = ld.D;
    float[] arrayOfFloat = new float[paramInt];
    float f1 = 0.0F;
    int i1 = 0;
    do
    {
      do
      {
        if (i1 >= paramInt) {
          break;
        }
        float f2 = (float)a(paramDouble, i1 - paramInt * 0.5D);
        arrayOfFloat[i1] = f2;
        f1 += f2;
        i1++;
        if (bool2) {
          break label84;
        }
        if (bool1) {
          break label82;
        }
      } while (!bool1);
    } while (bool2);
    i1 = 0;
    label82:
    label84:
    do
    {
      while (!bool1)
      {
        if (i1 >= arrayOfFloat.length) {
          break;
        }
        if ((!bool2) && (bool1)) {
          break label122;
        }
        arrayOfFloat[i1] /= f1;
        i1++;
      }
    } while (bool2);
    label122:
    return arrayOfFloat;
  }
  
  private static final double a(double paramDouble1, double paramDouble2)
  {
    boolean bool2 = ld.E;
    boolean bool1 = ld.D;
    double d1 = 1.0D / (Math.sqrt(6.283185307179586D) * paramDouble1);
    double d2 = 0.0D;
    double d3 = paramDouble2 - 0.5D;
    do
    {
      do
      {
        if (d3 >= paramDouble2 + 0.6D) {
          break;
        }
        d2 += d1 * Math.pow(2.718281828459045D, -d3 * d3 / (2.0D * paramDouble1 * paramDouble1));
        if (bool2) {
          break label109;
        }
        d3 += 0.1D;
        if (bool1) {
          break label107;
        }
      } while (!bool1);
    } while (bool2);
    d2 /= 11.0D;
    label107:
    label109:
    return d2;
  }
  
  static boolean a(ld paramld, Graphics2D paramGraphics2D, boolean paramBoolean)
  {
    boolean bool = ld.E;
    if (!bool) {
      if (paramBoolean)
      {
        if ((bool) || (kg.d(paramGraphics2D))) {
          if (bool) {}
        }
        return !Boolean.FALSE.equals(a(paramld));
      }
    }
    return Boolean.TRUE.equals(a(paramld));
  }
  
  private static Object a(ld paramld)
  {
    if ((ld.E) || ((paramld instanceof md))) {
      return ((md)paramld).c("y.view.ShadowNodePainter.SHADOW_PAINTING");
    }
    return null;
  }
}



/* Location:           E:\idea\

 * Qualified Name:     a.j.bd

 * JD-Core Version:    0.7.0.1

 */